<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function father() {
        this.test = 'faters';
      }
      function son() {
        this.olo = 'son';
      }

      // son.prototype = new father();

      var a = new son();
      console.log(a);
      console.log(a.__proto__);
      console.log(a.olo);
      console.log(a.test);

      console.log('________________________');

      function Person(area) {
        this.type = 'person';
        this.area = area;
      }
      Person.prototype.sayArea = function () {
        console.log(this.area);
      };
      var Father = function (age) {
        this.age = age;
      };
      Father.prototype = new Person('Beijin');
      console.log(Person.prototype.constructor); //function person()
      console.log(Father.prototype.constructor); //function person()
      Father.prototype.constructor = Father; //修正
      console.log(Father.prototype.constructor); //function father()
      var one = new Father(25);
    </script>
  </body>
</html>
